#ifndef INCLUDED_BASETASK_H
#define INCLUDED_BASETASK_H

#include <set>

namespace tinkle {

class BaseTask;
class Task;
class TaskManager;

class BaseTask {
public:
    BaseTask(Task *task, BaseTask *parent);
    BaseTask(TaskManager *mgr);
    ~BaseTask();

    BaseTask *GetParent() const;
    TaskManager *GetManager() const;

    void Abort();
    void AbortAllChild();

    bool IsChildTask(Task *task) const;
    bool HasChildTask() const;

private:
    void AddChild(Task *child);
    std::set<Task *> _children;
    BaseTask *_parent;
    TaskManager *_taskMgr;
};

}

#endif